package com.xiangxiao.rpan.storage.local;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/8/18 15:33
 */
@Component(value = "localStorageConfig")
@ConditionalOnProperty(prefix = "rpan.storage.processor", name = "type", havingValue = "com.xiangxiao.rpan.storage.local.LocalStorageProcessor")
public class LocalStorageConfig {
  private static final String DEFAULT_ROOT_FILE_NAME = "testFile";
  private final static String CHUNKS_FOLDER_NAME = "localchunks";
  /**
   * 实际存放路径前缀
   */
  private String rootFilePath = "/mydata" + File.separator + DEFAULT_ROOT_FILE_NAME + File.separator + "local";

  /**
   * 临时分片文件存放路径前缀
   */
  private String chunksPath = rootFilePath + File.separator + CHUNKS_FOLDER_NAME;

  public LocalStorageConfig() {
  }

  public String getRootFilePath() {
    return rootFilePath;
  }

  public void setRootFilePath(String rootFilePath) {
    this.rootFilePath = rootFilePath;
  }

  public String getChunksPath() {
    return chunksPath;
  }

  public void setChunksPath(String chunksPath) {
    this.chunksPath = chunksPath;
  }
}
